import Vue from 'vue'
import Router from 'vue-router'

import login from '@/pages/login' // 登陆
import layout from '@/pages/index/layout' // 首页
import index from '@/pages/index/index' // 首页
import checkAssets from '@/pages/index/checkAssets' // 查看固定资产
import checkLabel from '@/pages/index/checkLabel' // 查看电子标签
import addAssets from '@/pages/index/addAssets' // 新增固定资产
import addLabel from '@/pages/index/addLabel' // 新增电子标签
import checkArea from '@/pages/index/checkArea' // 查看区域
import checkReader from '@/pages/index/checkReader' // 查看阅读器
import placeArea from '@/pages/index/placeArea' // 布置区域
import placeReader from '@/pages/index/placeReader' // 布置阅读器

import guide from '@/pages/guide' // 新手向导
import inventory from '@/pages/inventory' // 实时盘点
import location from '@/pages/location' // 定位查找
import security from '@/pages/security' // 安全管理
import statistics from '@/pages/statistics' // 数据统计
import news from '@/pages/news' // 消息中心
import company from '@/pages/company' // 公司资料

Vue.use(Router)

export default new Router({
    // mode: 'history',
    mode: 'hash',
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/login',
            name: 'login',
            component: login,
        },
        {
            path: '/guide',
            name: 'guide',
            component: guide,
        },
        {
            path: '/layout',
            name: 'layout',
            component: layout,
            children: [
                {
                    path: '/layout/index',
                    name: 'index',
                    component: index
                },
                {
                    path: '/layout/checkAssets',
                    name: 'checkAssets',
                    component: checkAssets
                },
                {
                    path: '/layout/checkLabel',
                    name: 'checkLabel',
                    component: checkLabel
                },
                {
                    path: '/layout/addAssets',
                    name: 'addAssets',
                    component: addAssets
                },
                {
                    path: '/layout/addLabel',
                    name: 'addLabel',
                    component: addLabel
                },
                {
                    path: '/layout/checkArea',
                    name: 'checkArea',
                    component: checkArea
                },
                {
                    path: '/layout/checkReader',
                    name: 'checkReader',
                    component: checkReader
                },
                {
                    path: '/layout/placeArea',
                    name: 'placeArea',
                    component: placeArea
                },
                {
                    path: '/layout/placeReader',
                    name: 'placeReader',
                    component: placeReader
                },
            ]
        },
        {
            path: '/inventory',
            name: 'inventory',
            component: inventory
        },
        {
            path: '/location',
            name: 'location',
            component: location
        },
        {
            path: '/security',
            name: 'security',
            component: security
        },
        {
            path: '/statistics',
            name: 'statistics',
            component: statistics
        },
        {
            path: '/news',
            name: 'news',
            component: news
        },
        {
            path: '/company',
            name: 'company',
            component: company
        },
    ]
})
